<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="author" content="lijinbo" />
    <meta name="cdnload" content="jquery" />
    <title>161-盘点open打开新窗口那些高级用法</title>
    <style>
      li {
        padding: 16px;
      }
      .btn3 {
        display: block;
        margin: 8px;
      }
    </style>
  </head>

  <body>
    <div class="box">
      <p>
        <a href="https://developer.mozilla.org/zh-CN/docs/Web/API/Window/open" target="_blank">
          window.open 参数介绍
        </a>
      </p>
      <ol>
        <li>
          <button id="btn1">打开新窗口</button>
        </li>
        <li>
          <button id="btn2">打开新窗口并监听新窗口的关闭</button>
        </li>
        <li>
          <p>打开新窗口的几种命名区别</p>
          <button class="btn3" data-type="_blank">_blank - 默认打开新窗口</button>
          <button class="btn3" data-type="_parent">_parent - url加载到父级框架</button>
          <button class="btn3" data-type="_self">_self - url替换当前页面</button>
          <button class="btn3" data-type="_top">_top - url替换任何可加载的框架集</button>
        </li>
        <li>
          <button id="btn4">打开新窗口并指定位置和大小</button>
        </li>
      </ol>
    </div>
    <script type="module" src="./161-main.js"></script>
  </body>
</html>
